/*=========================================================================

Program:   Virtual Surgery
Language:  C++
Date:      2009-9-1
Version:   0.1
Mail:		   nelfylee@gmail.com

Copyright (c) 2009 Nelfy Lee. All rights reserved.

=========================================================================*/
#ifndef _SURFACE_SOURCE_H_
#define _SURFACE_SOURCE_H_

#include "Source.h"

#include "vtkPlaneWidget.h"
#include "vtkProperty.h"



class SurfaceSource : public Source
{
public:
	SurfaceSource(QString text);
	~SurfaceSource();

	void setData(vtkPolyData* data, vtkImageData* idata=NULL);
	vtkPolyData* sdata();

	virtual vtkActor* outlineActor();
	virtual vtkProp* sourceModel(bool refresh=false);

	void setOpacity(float opacity);
	float opacity();

	virtual void setSurfaceColor(const QColor &color);
	virtual void setSurfaceColor(int colorTableItem);
	virtual QColor surfaceColor();

	void rebuildSurface(int n, double start, double end);
	
	double* getPosition();
	double* getBounds();
	void setPosition(double*);


private:
	vtkPolyData *m_vtkPolyData;
	float m_opacity;						// 0 ~ 1
	QColor m_surfaceColor;

	int m_smSurfaceValue;
	vtkContourFilter *m_smContour;
	vtkPolyDataNormals *m_smNormals;
	vtkStripper *m_smStripper;
	vtkPolyDataMapper *m_smPolyDataMapper;
	vtkActor *m_smActor;
};



#endif



